/**
  * Author: Mei
  * Date: 2020-11-24 10:24
  * Description: 
  *
  */
#include <iostream>

using namespace std;

int main() {
    ThreadPool pool(4);
    std::vector<std::future<int>> results;
    for (int i = 0; i < 8; ++i) {
        results.emplace_back(pool.submit([]() {
            // computing task and return result
        }));
    }
    for (auto &&result: results)
        std::cout << result.get() << ' ';

    return 0;
}